<%@ include file="/common/taglibs.jsp" %>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
 <probiz:ui_tabs tabsId="detail" />

<div class="top clearfix">
	<ul class="tab" id="detail">
		<li class="curr">
			<a href="#tab-summary"><span><fmt:message key="productCategoryDetail.tab.summary" /> </span> </a>
		</li>
		<li>
			<a href="#tab-recommended"><span><fmt:message key="productCategoryDetail.tab.recommended" /> </span> </a>
		</li>
		<li>
			<a href="#tab-other"><span><fmt:message key="productCategoryDetail.tab.other" /> </span> </a>
		</li>
	</ul>
</div>
<div class="modify">
	<form id="productCategoryForm" name="productCategoryForm" action="${ctxPath}/product/productCategory.html">
	    <%@ include file="./include/productCategoryFormSummary.jspf" %>
	    <%@ include file="./include/productCategoryFormRecommended.jspf" %>
	    <%@ include file="./include/productCategoryFormSeoOther.jspf" %>
	</form>
</div>

<v:javascript formName="productCategory" staticJavascript="false"/>

<div style="display:none">
	<product:productSelector selectorId="productSelector" callbackFunc="selectRecommendedProductCallback" multiple="true"/>
	<probiz:plugin_upload fileInputId="imageUrl" uploadFileTypes="gif,jpg" uploadCategory="category" onComplete="uploadCategoryImagehandler"/>
</div>

<script type="text/javascript">
$j(document).ready(function () {
	<%--start:初始化变量--%>		
	initVariables();
	<%--end:初始化变量--%>		
	
	displayButtons("${category.categoryId}");
	
	<%--start:初始化关联商品--%>
	<c:forEach items="${category.recommendedProducts}" var="rp">
		addManulProduct({"id":"${rp.product.productId}","name":"${rp.product.productName}","imageUrl":"${rp.product.imageUrl}"},${rp.recommendedType.recommendedTypeId});
	</c:forEach>
	<%--end:初始化关联商品--%>
	
	//start:quickTip 生成 原因：在tag中$j无法扑捉到对象
	$j('[quickTip]').each(function(){
      $j(this).after('<img id="'+this.id+'_tip" width="14" height="14" src="'+__ctxPath+'/images/validate/info.gif"/>');
		$j('#'+this.id+'_tip').PQuickTip({
	         source:'text',
	         title:'Help',
	         type:'help',
	         text:$j(this).attr("quickTip")
      	});
	
	});
	//end:quickTip 生成
	<%--start:sortable--%>
	<c:forEach items="${recommendedTypeList}" var="recommendedType">
		$j('#manualProductsDiv_${recommendedType.recommendedTypeId}').sortable();
	</c:forEach>
	<%--end:  sortable--%>
	
	applyValidate($("categoryCode"),"code");
});
</script>